<?php

class Activity_Model_DbTable_Object extends Euso_Db_Table_Abstract
{
	// Singleton instance
    protected static $_instance = null;

    protected $_name = 'activity_objects';
	protected $_primary = 'activity_id';

	public function __construct()
    {
		// Temporary, use single database for each module
		if (Zend_Registry::isRegistered('module_activity_db') === TRUE) {
			$tmpdb = Zend_Registry::get('module_activity_db');
		}
		if ($tmpdb === null) {
			$dbfilename = DATA_PATH .'/activity.sqlite';
			$tmpdb = new Zend_Db_Adapter_Pdo_Sqlite(array('dbname' => $dbfilename));
			Zend_Registry::set('module_activity_db', $tmpdb);
		}
		parent::__construct(array('db' => 'module_activity_db'));
    }

    private function __clone()
    {
    }

    public static function getInstance()
    {
        if (null === self::$_instance) {
            self::$_instance = new self();
        }

        return self::$_instance;
    }
}
